< Prev(J) / Next(K) > / View :

Filename: /text/sbasic/shared/03120101.xhp

(section: asc) (bookmark: bm_id3150499)
Asc function

Asc 関数

Asc Function [Runtime]
Asc 関数 [実行時](hd_id3150499.1)

Returns the ASCII (American Standard Code for Information Interchange) value of the first character in a string expression.
与えられた文字列表式の最初の文字について、該当する ASCII (American Standard Code for Information Interchange) コードを返します。(par_id3151384.2)

(/section: asc)

Syntax:
構文:(hd_id3155555.3)

Asc (Text As String)
Asc (Text As String)(par_id3143267.4)

Return value:
戻り値:(hd_id3147242.5)

Integer
整数(par_id3150669.6)

Parameters:
パラメータ:(hd_id3148473.7)

Text: Any valid string expression. Only the first character in the string is relevant.
Text: 変換させる文字列表式。変換対象は、文字列の最初の文字だけです。(par_id3149415.8)

Use the Asc function to replace keys with values. If the Asc function encounters a blank string, Office Basic reports a run-time error. In addition to 7 bit ASCII characters (Codes 0-127), the ASCII function can also detect non-printable key codes in ASCII code. This function can also handle 16 bit unicode characters.
Asc 関数は、キーを値に置換する際に使用します。Asc 関数が空白文字列を検出すると、Office Basic は実行時エラーを返します。ASCII 関数は、7 ビットの ASCII 文字 (コード 0 から 127) だけでなく、ASCII コード中に含まれる非印刷用のキーコードも検出できます。またこの関数は、16 ビット unicode 文字も処理できます。(par_id3145609.9)

(embed text/sbasic/shared/00000003.xhp#errorcode : linkinfo)

Error Codes

エラーコード(hd_id3152869.37)

(/embed text/sbasic/shared/00000003.xhp#errorcode)

(embed text/sbasic/shared/00000003.xhp#err5 : linkinfo)

5 Invalid procedure call
5 無効なプロシージャー呼び出しです (par_id3150891.41)

(/embed text/sbasic/shared/00000003.xhp#err5)

Example:
例:(hd_id3159413.10)

Sub ExampleASC
Sub ExampleASC(par_id3149457.11)

Print ASC("A") REM returns 65
Print ASC("A") REM 戻り値は 65(par_id3150792.12)

Print ASC("Z") REM returns 90
Print ASC("Z") REM 戻り値は 90(par_id3148797.13)

Print ASC("Las Vegas") REM returns 76, since only the first character is taken into account
Print ASC("Las Vegas") REM 認識されるのは最初の文字だけなので、戻り値は 76(par_id3163800.14)

End Sub
End Sub(par_id3148674.15)

CHR
CHR(par_idN1067B.)


< Prev / Next >